package org.springblade.demo.feign;

import lombok.AllArgsConstructor;
import org.springblade.core.tool.api.R;
import org.springblade.demo.entity.Blog;
import org.springblade.demo.service.BlogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
@AllArgsConstructor
public class BlogClientImpl implements BlogClient {

	@Autowired
	private BlogService blogService;
	@Override
	@GetMapping(API_PREFIX + "/detail/{id}")
	public R<Blog> detail(@PathVariable("id") Long id) {
		return R.data(blogService.getById(id));
	}
}
